import request from '@/config/axios'

// 健康档案 VO
export interface HealthProfileVO {
  id: number // 档案id
  userId: number // 用户id
  bloodType: string // 血型
  height: number // 身高(cm)
  weight: number // 体重(kg)
  allergyHistory: string // 过敏史
  chronicDisease: string // 慢性病史
}

// 健康档案 API
export const HealthProfileApi = {
  // 查询健康档案分页
  getHealthProfilePage: async (params: any) => {
    return await request.get({ url: `/remind/health-profile/page`, params })
  },

  // 查询健康档案详情
  getHealthProfile: async (id: number) => {
    return await request.get({ url: `/remind/health-profile/get?id=` + id })
  },

  // 新增健康档案
  createHealthProfile: async (data: HealthProfileVO) => {
    return await request.post({ url: `/remind/health-profile/create`, data })
  },

  // 修改健康档案
  updateHealthProfile: async (data: HealthProfileVO) => {
    return await request.put({ url: `/remind/health-profile/update`, data })
  },

  // 删除健康档案
  deleteHealthProfile: async (id: number) => {
    return await request.delete({ url: `/remind/health-profile/delete?id=` + id })
  },

  // 导出健康档案 Excel
  exportHealthProfile: async (params) => {
    return await request.download({ url: `/remind/health-profile/export-excel`, params })
  },
}
